first check in

not production ready, will need some more work to be a standalone plugin