Refactored a lot of code -- split many functions into separate module.
Updated readme with new instructions and conventions.