First revision

Basic functionality implemented, not much to play with yet.