Sdk lib restructure

Restructuring the SDK libs into several libs, each with their own src, tests and resources dirs.
Some SDK JS tests now pass, others still need some work to make them pass once this has been merged across.