More testing and updating

Restructured code, did some housekeeping, created prototypes, added some
more functionalities