Atma.js: update and refactor (closes GH-816)

Hello Team,

have just updated the libraries to the last versions, refactored and ensured it passes the tests.
_Should the `bower_components` folder be removed from the PR, please give me a note._

Thanks, Alex