restructured code, improved type wrapper

split code over separate files
add task to combine declaration files and export single module
cleanup indentation & project