Cleaning up Angular javascript services. 

Started implementing plan editing.