How would I go about building a movable-arm keyboard & mouse tray?
These things do exist. 

However, there is an interesting idea in the first review on this page. 

The reviewer suggests using a Monitor arm, and attaching a custom surface to the VESA plate. 

Benefits of this are that the monitor arm is sturdier, and that it is much cheaper. Good monitor arms can be found for &lt; £30 as opposed to ~£200 for a custom keyboard tray arm.