Apps API

@roseleaf @maximeprades 

Need to add some tests and documentation for a couple things, but the basics are here.